package com.zzuli.practice.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.zzuli.practice.entity.User;
import com.zzuli.practice.mapper.UserMapper;
import com.zzuli.practice.service.IHeaderImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HeaderImgService implements IHeaderImgService {

    @Autowired
    private UserMapper userMapper;

    public int updateHeaderImg(String username, String headerUrl){
        UpdateWrapper<User> wrapper = new UpdateWrapper<>();
        wrapper.eq("username", username);
        wrapper.set("headerimg", headerUrl);
        return userMapper.update(null, wrapper);
    }


}
